import { IRequestConfig, IApiControl } from './BaseInterface'
import AxiosRequest from './example/AxiosRequest'
import { DefaultConfig, ApiControlConfig } from './config'

/**
 * 使用参见
 * https://gitee.com/lijinbode/mc-request/blob/master/README.md
 */

/**
 * 创建请求实例
 * @param config 基础配置
 * @param apiConfig 请求调控
 * @returns 
 */
function createRequest(config: IRequestConfig, apiConfig: IApiControl): AxiosRequest {
    return new AxiosRequest(Object.assign({}, DefaultConfig, config), Object.assign({}, ApiControlConfig, apiConfig));
}


export default createRequest